import Router from 'vue-router'

function load(component) {
  // '@' is aliased to src/page
  return () => import(`@/page/${component}.vue`)
}

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Home',
      component: load('Home')
    },
    {
      path: '/register',
      name: 'Register',
      component: load('Register')
    },
    {
      path: '/pufa',
      name: 'Pufa',
      component: load('Pufa')
    },
    {
      path: '/yasf',
      name: 'PufaVideo',
      component: load('PufaVideo')
    },
    {
      path: '/list/:diagramId',
      name: 'List',
      component: load('List')
    },
    {
      path: '/listchildren/:diagramId',
      name: 'ListChildren',
      component: load('ListChildren')
    },
    {
      path: '/post/:id',
      name: 'Post',
      component: load('Post')
    },
    {
      path: '/service/:name',
      name: 'Service',
      component: load('Service')
    },
    {
      path: '/map',
      name: 'MapList',
      component: load('MapList')
    },
    {
      path: '/map/:org_type',
      name: 'Map',
      component: load('Map')
    },
    {
      path: '/lvshi',
      name: 'ShequLvshi',
      component: load('ShequLvshi')
    },
    {
      path: '/zixun',
      name: 'Advisory',
      component: load('Advisory')
    },
    {
      path: '/zixun/:index',
      name: 'AdvisoryIn',
      component: load('AdvisoryIn')
    },
    {
      path: '/law',
      name: 'Law',
      component: load('Law')
    },
    {
      path: '/lawfirm',
      name: 'LawFirm',
      component: load('LawFirm')
    },
    {
      path: '/case',
      name: 'Case',
      component: load('Case')
    },
    {
      path: '/jianding',
      name: 'JianDing',
      component: load('JianDing')
    },
    {
      path: '/test/:id',
      name: 'Test',
      component: load('Test')
    },
    {
      path: '/bind_mobile',
      name: 'BindMobile',
      component: load('BindMobile')
    },
    {
      path: '/reservation/0/1',
      name: 'Reservation',
      component: load('Reservation')
    },
    {
      path: '/arc',
      name: 'Arc',
      component: load('Arc')
    },
    {
      path: '/gzpost',
      name: 'GzPost',
      component: load('GzPost')
    },
    // 测试
    {
      path: '/jd',
      name: 'JD',
      component: load('JD')
    },
    {
      path: '/jdlist',
      name: 'JDList',
      component: load('JDList')
    },
    {
      path: '/jdpost',
      name: 'JDPost',
      component: load('JDPost')
    },
    {
      path: '/caselibrary',
      name: 'CaseLibrary',
      component: load('CaseLibrary')
    },
    {
      path: '/caselibrary/:case_id',
      name: 'CaseLibraryPost',
      component: load('CaseLibraryPost')
    },
    {
      path: '/suggest',
      name: 'Suggest',
      component: load('Suggest')
    },
    {
      path: '/tests',
      name: 'Tests',
      component: load('Tests')
    }
  ]
})
